<template>
  <div>
    <div v-if="flag" class="box" :style="{ width, height }">
      <h1>{{ title }}</h1>
      <main class="main">
        <slot></slot>
      </main>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  //2.接收flag值
  props: {
    flag: {
      type: Boolean
    },
    width: {
      type: String,
      default: '50%'
    },
    height: {
      type: String,
      default: '50%'
    },
    title: {
      type: String,
    },

  },
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
  },
  methods: {

  }
}
</script>
<style lang='less'  scoped>
.box {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  main {
    flex: 1;
  }
}
</style>
